if (!requireNamespace("tidyverse", quietly = TRUE))
install.packages('tidyverse')
if (!requireNamespace("Seurat", quietly = TRUE))
install.packages('Seurat')
if (!requireNamespace("compositions", quietly = TRUE))
install.packages('compositions')
if (!requireNamespace("colorBlindness", quietly = TRUE))
install.packages('colorBlindness')
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
if (!requireNamespace("EnhancedVolcano", quietly = TRUE))
BiocManager::install("EnhancedVolcano")
if (!requireNamespace("ComplexHeatmap", quietly = TRUE))
BiocManager::install("ComplexHeatmap")
if (!requireNamespace("scales", quietly = TRUE))
install.packages('scales')
if (!requireNamespace("viridis", quietly = TRUE))
install.packages('viridis')
if (!requireNamespace("DT", quietly = TRUE))
install.packages('DT')
if (!requireNamespace("reshape2", quietly = TRUE))
install.packages('reshape2')
if (!requireNamespace("ggrepel", quietly = TRUE))
install.packages("ggrepel")
if (!requireNamespace("sccomp", quietly = TRUE))
devtools::install_github("stemangiola/sccomp")4 - Compositional Analysis
Introduction
In this notebook we will study which cell types compose different samples in single-cell data. We will do this using a subset of statistics called compositional data analysis (or CoDA for short), because single-cell experiments are small samples of a larger tissue so the cells we obtain represent only the proportions of each cell type in the tissue, not their true abundance.
CoDA relativizes proportions by comparing them to a stable population, comparing them to each other, or to a mean across samples, all resulting in a table of relative abundances of cell types per sample. This sample x species matrix is a natural foundation for conducting case-control analysis, as we have a single vector of variables per sample. Here, we can scrutinize variances between conditions and between samples.
With compositions, we can be as granular as our data allows us. Some studies [@zheng_concerted_2023][@dann_differential_2022] have suggested that higher-resolution sub-clusters are where biological differences are most prominent. Compositions can be normalized within cell type or subtype so case-control analysis can be performed at this level, with multiple resolutions using advanced methods, or at a more general low-resolution clustering level. I’ve written a tool for automated sub-clustering and sub-cluster annotation, ARBOL, which is available in R and python.
For teaching purposes, here we will use the cell type annotations the authors provide and include all celltypes in our compositional analysis.
Useful Resources
- John Aitchison’s Compositional Data Analysis [@aitchison_statistical_1982]
- scCODA, a python + scanpy package for ALR compositional analysis [@buttner_sccoda_2021]
- Cacoa, an R package for case-control analysis that uses ILR
- compositions, an R package for CoDA
- A paper describing the compositionality problem in terms of microbiome studies [@morton_establishing_2019]
- sccomp - an R method for single-cell compositional comparisons https://github.com/stemangiola/sccomp
Key Takeaways
- Compositions provide a good foundation for comparing individual samples
- The compositional nature of scRNAseq means only conclusions about relative values can be made, and overall cell density can bias results
- Compositional transforms allow quantitative assessment of scRNA relative abundances
Libraries
Installation
Load Libraries
library(colorBlindness)
library(tidyverse)
library(EnhancedVolcano)
library(viridis)
library(scales)
library(DT)
library(Seurat)
library(compositions)
library(reshape2)
library(ComplexHeatmap)
library(ggrepel)
library(sccomp)Load data
se <- readRDS("../data/se_lvl1.rds")Other setup
Generate a color palette for plotting
donor_pal <- c(
"#66C2A4", "#41AE76", "#238B45", "#006D2C",
"#41B6C4", "#1D91C0", "#225EA8", "#253494",
"#FD8D3C", "#FC4E2A", "#E31A1C", "#BD0026",
"#ad393b", "#800000", "#800050")
names(donor_pal) <- c(
"T024", "T036", "T44", "T057", "T110", "T160", "T161", "T182",
"T017", "T019", "T176", "T189", "T197", "T203", "T202"
)
pal <- c(
# Epithelial lineage
"crypt" = "#FFB347",
"TA" = "#FFA500",
"early enterocyte" = "#FFD580",
"enterocyte" = "#FF8C00",
"enteroendocrine" = "#FFC04C",
"BEST4 enterocyte" = "#FF9900",
"Goblet cell" = "#DA70D6",
"IL2RG+ enterocyte (M cell)" = "#E9967A",
"Paneth cell" = "#FF6347",
"Tuft" = "#F08080",
# Fibroblast lineage
"S1 fibroblasts" = "#8B4513",
"S2 fibroblasts" = "#A0522D",
"S4 fibroblasts" = "#CD853F",
"myofibroblast" = "#D2B48C",
# Stromal/glial/perivascular
"Glial cell" = "#708090",
"pericyte" = "#3CB371",
# Endothelial cells
"Arterial endothelial cell" = "#DC143C",
"Venous endothelial cell" = "#B22222",
"Lymphatic endothelial cell" = "#008080",
# B lineage
"Memory B cell" = "#4682B4",
"B cell" = "#5A9BD4",
"FCER2 B cell" = "#6495ED",
"Activated B cell" = "#1E90FF",
"Cycling B cell" = "#87CEFA",
# Plasma cells
"IgA plasma cell" = "#6A5ACD",
"IgG plasma cell" = "#7B68EE",
"Cycling plasma cell" = "#8470FF",
# T lineage
"CD8 T cell" = "#228B22",
"CD4 T cell" = "#32CD32",
"Activated T" = "#66CDAA",
"Treg" = "#2E8B57",
"Tfh" = "#20B2AA",
"gd T/NK cell" = "#556B2F",
# Myeloid lineage
"Monocyte" = "#DAA520",
"Cycling myeloid cells" = "#F0E68C",
"Macrophage" = "#B8860B",
"cDC1" = "#CD5C5C",
"cDC2" = "#F4A460",
"pDC" = "#D2691E",
"activated DC" = "#DEB887",
# Mast cells
"mast cells" = "#9932CC"
)# Create a function to perform Wilcoxon rank-sum tests and return p-values
perform_wilcox_test <- function(data, group_col, group1, group2, species_col) {
group1_data <- data[data[[group_col]] == group1, species_col]
group2_data <- data[data[[group_col]] == group2, species_col]
test_result <- wilcox.test(group1_data, group2_data)
return(data.frame(
p.val = test_result$p.value,
statistic = test_result$statistic,
species = species_col,
test = paste(group1,'vs',group2)))
}Generate a sample x celltype composition table
In papers we often see percentages of clusters per sample or of subclusters in a larger celltype. These are done using stacked bar plots as follows.
celltypePercentagesDF <- se@meta.data %>%
count(sample_id, annotation_V2, Diagnosis) %>%
group_by(sample_id, Diagnosis) %>%
reframe(annotation_V2, celltype_n = n, total_n_cells = sum(n)) %>%
mutate(pct_celltype = celltype_n / total_n_cells)
datatable(celltypePercentagesDF)celltypePercentagesDF %>%
ggplot(aes(x = sample_id, y = pct_celltype, fill = annotation_V2),
color = 'white') +
geom_bar(position='stack', stat='identity') +
scale_fill_manual(values = pal) +
ggtitle('Composition of each sample by celltype') +
theme_linedraw(base_size = 20) +
theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1))Understanding Compositional Data Analysis


Comparing compositions with Wilcoxon tests
For simplicity all comparisons in this notebook will be made between annotation_V2 and normal samples, with annotation_V2 in the positive direction.
Compositions are often compared using rank sum tests, which Morton et al [@morton_establishing_2019] show is a great way to avoid the compositionality problem. It avoids the problem by only making conclusions about relative abundance rather than absolute abundance, because a cell type’s rank is dependent on the other cell types. The most commonly used rank test is the Wilcoxon test (aka Mann-Whitney U test), the default test Seurat uses for comparisons of genes across clusters with FindAllMarkers.
If we use the Wilcoxon test here in a comparison of compositions across samples annotation_V2 vs. Normal, we will see that the result depends on proper normalization of the data.
rawTb <- celltypePercentagesDF %>%
mutate(sample = glue::glue("{sample_id}-{Diagnosis}")) %>%
dplyr::select(sample, group=Diagnosis, annotation_V2, celltype_n) %>%
pivot_wider(names_from=annotation_V2, values_from = celltype_n, values_fill=0) %>%
separate(sample, sep = "-", into=c('sample','group'), remove=FALSE)
# Create a long dataframe of raw values for comparisons
raw_long <- rawTb %>%
pivot_longer(-c(group, sample), names_to="species", values_to="counts") %>%
mutate(transform = "Raw Counts")
species_col_names <- colnames(rawTb)[3:ncol(rawTb)]
wilcoxon_raw <- lapply(species_col_names, function(species) {
print(species)
perform_wilcox_test(
data = data.frame(rawTb, check.names = FALSE),
group_col = "group",
group1 = "Normal control",
group2 = 'Crohn Disease',
species_col = species)
})[1] "crypt"
[1] "TA"
[1] "early enterocyte"
[1] "enterocyte"
[1] "enteroendocrine"
[1] "BEST4 enterocyte"
[1] "Goblet cell"
[1] "IL2RG+ enterocyte (M cell)"
[1] "Paneth cell"
[1] "Tuft"
[1] "S1 fibroblasts"
[1] "S2 fibroblasts"
[1] "S4 fibroblasts"
[1] "myofibroblast"
[1] "Glial cell"
[1] "pericyte"
[1] "Arterial endothelial cell"
[1] "Venous endothelial cell"
[1] "Lymphatic endothelial cell"
[1] "Memory B cell"
[1] "IgA plasma cell"
[1] "IgG plasma cell"
[1] "CD8 T cell"
[1] "CD4 T cell"
[1] "Activated T"
[1] "Treg"
[1] "gd T/NK cell"
[1] "Monocyte"
[1] "Cycling myeloid cells"
[1] "Macrophage"
[1] "cDC1"
[1] "cDC2"
[1] "B cell"
[1] "FCER2 B cell"
[1] "Activated B cell"
[1] "Cycling B cell"
[1] "Cycling plasma cell"
[1] "Tfh"
[1] "pDC"
[1] "activated DC"
[1] "mast cells"
wilcoxon_raw <- wilcoxon_raw %>%
bind_rows %>%
data.frame %>%
mutate(transform = "Raw")pctTb <- celltypePercentagesDF %>%
mutate(sample = glue::glue("{sample_id}-{Diagnosis}")) %>%
dplyr::select(sample, group=Diagnosis, annotation_V2, pct_celltype) %>%
pivot_wider(names_from=annotation_V2, values_from = pct_celltype, values_fill=0) %>%
separate(sample, sep = "-", into=c('sample','group'), remove=FALSE) # reorganize dataframe for wilcoxon tests
# Create a long dataframe of percent values for comparisons
pct_long <- pctTb %>%
pivot_longer(-c(group, sample), names_to="species", values_to="counts") %>%
mutate(transform = "Percentages")
wilcoxon_pct <- lapply(species_col_names, function(species)
perform_wilcox_test(data.frame(pctTb, check.names = FALSE),
group_col = "group",
group1 = 'Normal control',
group2 = 'Crohn Disease',
species_col = species))
wilcoxon_pct <- wilcoxon_pct %>% bind_rows %>% data.frame %>% mutate(transform = "Percent")Combine raw and pct dataframes and visualize
combined_data <- bind_rows(raw_long, pct_long)
combined_data %>%
filter(group %in% c('Normal control','Crohn Disease')) %>%
ggplot(aes(x = species, y=counts, fill = group)) +
geom_boxplot() +
facet_wrap(~ transform, scales = "free_y") +
labs(title = "Comparison of Species Counts per Group",
x = "Species",
y = "Counts / Percentages") +
theme_minimal(base_size = 20) +
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5),
legend.title = element_blank()) +
scale_fill_manual(values = unname(pal[c(1,4)]))wilcoxon_comparisons <- bind_rows(wilcoxon_raw,wilcoxon_pct)
ggplot(wilcoxon_comparisons, aes(x = reorder(species, p.val), y = p.val, color = p.val < 0.05)) +
geom_point() + # Use geom_bar() for bar plots
scale_color_manual(values = c("TRUE" = "red", "FALSE" = "blue"), name = "p-val < 0.05") +
facet_wrap(~ transform, scales = "free_x") +
labs(x = "Species", title = "Comparison of P-Values Across Species and Transformations") +
theme_minimal(base_size = 20) +
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5),
legend.position = "top") +
guides(fill = guide_legend(title = "P-value < 0.05"))Compositional transforms
The compositions package provides compositional transforms that allow quantitative comparisons of compositional data. In the most popular package for compositional analysis in scRNA, scCODA, the additive-log-ratio is used, where compositions are transformed to log-ratios of the cluster with the least dispersion that is present across 95% of all samples.
\text{ALR}(x_i) = \log\left(\frac{x_i}{x_D}\right)
where:
- \log denotes the natural logarithm,
- x_i is the value of component i in the composition,
- x_D is the chosen reference component from the compositional dataset.
\text{CLR}(x_i) = \log\left(\frac{x_i}{g(x)}\right)
where:
- \log denotes the natural logarithm,
- x_i is the value of component i in the composition,
- g(x) is the geometric mean of all components in the composition, calculated as g(x) = \left(\prod_{i=1}^{D} x_i\right)^{\frac{1}{D}}, with D being the total number of components in the composition. \prod_{} means multiply each x_i, so you can think of it as an extension of the pythagorean theorem to any n components
The CLR is very easy to use in practice because it does not require a reference. In datasets with very noisy cell subtypes or very different samples, it can be better than the ALR, which can fail when there isn’t a good reference cluster. For this notebook, we can calculate the ALR in a similar way to what scCODA (the first CODA package built into scanpy) does by choosing the reference based on which cluster has minimal dispersion and at least 95% presence across samples
compTb <- pctTb
clrTb <- compositions::clr(compTb[,-c(1,2)]) %>% data.frame
colnames(clrTb) <- species_col_names
clrTb$group <- compTb$group
clrTb$sample <- compTb$sample
# Create a long dataframe of raw values for comparisons
clr_long <- clrTb %>%
pivot_longer(-c(group, sample), names_to = "species", values_to = "counts") %>%
mutate(transform = "CLR")
wilcoxon_clr <- lapply(species_col_names, function(species)
perform_wilcox_test(data.frame(clrTb, check.names = FALSE),
group_col = "group",
group1 = 'Normal control',
group2 = 'Crohn Disease',
species_col = species))
wilcoxon_clr <- wilcoxon_clr %>% bind_rows %>% data.frame %>% mutate(transform = "CLR")
presence_threshold <- 0.95
presence <- apply(compTb > 0, 2, function(x) mean(x)) > presence_threshold
# make sure group column isn't included
presence[1] <- FALSE
presence[2] <- FALSE
iqr_values <- apply(compTb[, presence], 2, IQR)
denominator_index <- which.min(iqr_values)
denominator_name <- names(iqr_values[denominator_index])Compute ALR transformations
alrTb <- compositions::alr(rawTb[,-c(1, 2)] + 1, # apply a tiny pseudocount to avoid logarithmizing a 0
ivar = denominator_name) %>% #ivar is the invariant variable
data.frame
alr_col_names <- species_col_names[species_col_names!=denominator_name]
colnames(alrTb) <- alr_col_names
alrTb$group <- compTb$group
alrTb$sample <- compTb$sample
alr_long <- alrTb %>%
pivot_longer(-c(group, sample), names_to="species", values_to="counts") %>%
mutate(transform = "ALR")Visualize transformations
combined_data <- bind_rows(combined_data, clr_long, alr_long)
ggplot(combined_data %>% filter(group %in% c('Normal control','Crohn Disease')),
aes(x = species, y=counts, fill = group)) +
geom_boxplot() +
labs(title = "Comparison of Species Counts per Group",
x = "Species",
y = "values") +
theme_minimal(base_size = 20) +
theme(axis.text.x = element_text(angle=90, hjust=1, vjust = 0.5),
legend.title = element_blank()) +
scale_fill_manual(values = unname(pal[c(1,4)])) +
facet_wrap(~ transform, scales = "free_y")Wilcoxon test for ALR composition
wilcoxon_alr <- lapply(alr_col_names, function(species)
perform_wilcox_test(data.frame(pctTb, check.names = FALSE),
group_col = "group",
group1 = 'Normal control',
group2 = 'Crohn Disease',
species_col = species))
wilcoxon_alr <- wilcoxon_alr %>% bind_rows %>% data.frame %>% mutate(transform = "ALR")
wilcoxon_comparisons <- bind_rows(wilcoxon_comparisons,wilcoxon_clr,wilcoxon_alr)ggplot(wilcoxon_comparisons, aes(x = reorder(species, p.val), y = p.val, color = p.val < 0.05)) +
geom_point(size = 3) +
scale_color_manual(values = c("TRUE" = "red", "FALSE" = "blue"), name = "p-val < 0.05") +
facet_wrap(~ transform, scales = "free_x") +
labs(x = "Species", title = "Comparison of P-Values Across Species and Transformations") +
theme_minimal(base_size = 20) +
theme(
axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5),
legend.position = "top") +
guides(fill = guide_legend(title = "P-value < 0.05"))We can see that calculating rank sum differences across samples can produce a lot of false positives if we don’t normalize our data properly. But even with mere normalization to overall cell number, the Wilcoxon shows similar results to ALR. This is because the ranks of cell population proportions do not change much with normalization. If we used a Bayesian or parametric test, we would find more false positives with the percentages than with the compositional transforms.
The “best practice” method that has been shown to be successful for compositional analysis in microbiome [@noauthor_anova-like_nodate] and single-cell data [@mangiola_sccomp_2023] is composition-transform paired with binomial distribution modeling ANOVA tests. sccomp is available on github
Estimating a size effect in compositional data
We can see that calculating rank sum differences across samples can produce a lot of false positives if we don’t normalize our data properly. But even with mere normalization to overall cell number, the Wilcoxon shows similar results to ALR. This is because the ranks of cell population proportions do not change much with normalization. If we used a Bayesian or parametric test, we would find more false positives with the percentages than with the compositional transforms.
The “best practice” method that has been shown to be successful for compositional analysis in microbiome [@noauthor_anova-like_nodate] and single-cell data [@mangiola_sccomp_2023] is composition-transform paired with binomial distribution modeling ANOVA tests. sccomp is available on github
# se$sample <- se$sample_id %>% str_replace_all(' ','')
#
# se$disease <- se$sample_id %>% str_replace_all("\\ .*","")
sccomp_est <- subset(se[, se$Diagnosis %in% c('Normal control','Crohn Disease')]) %>%
sccomp_estimate(
formula_composition = ~ 0 + Diagnosis,
formula_variability = ~ 0 + Diagnosis,
.sample = sample_id,
.cell_group = annotation_V2,
bimodal_mean_variability_association = TRUE,
cores = 4
)Path [7] :Initial log joint density = -84127.917107
Path [1] :Initial log joint density = -84022.606626
Path [26] :Initial log joint density = -85532.005481
Path [13] :Initial log joint density = -84305.535086
Path [26] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.167e+04 2.767e-02 2.679e+04 2.481e-02 2.481e-02 2501 -3.559e+04 -3.559e+04
Path [26] :Best Iter: [21] ELBO (-2678.295979) evaluations: (2501)
Path [7] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.178e+04 4.063e-02 2.516e+03 3.173e-02 3.173e-02 2501 -3.275e+04 -3.275e+04
Path [7] :Best Iter: [33] ELBO (-2657.551785) evaluations: (2501)
Path [13] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.182e+04 7.009e-02 2.298e+03 2.198e-02 3.847e-02 2501 -9.541e+03 -9.541e+03
Path [13] :Best Iter: [43] ELBO (-2663.827130) evaluations: (2501)
Path [27] :Initial log joint density = -84042.245474
Path [1] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.184e+04 1.609e-01 1.905e+03 3.101e-02 3.101e-02 2501 -2.033e+09 -2.033e+09
Path [1] :Best Iter: [43] ELBO (-2672.834758) evaluations: (2501)
Path [8] :Initial log joint density = -96745.673200
Path [14] :Initial log joint density = -84284.826985
Path [2] :Initial log joint density = -84799.361519
Path [27] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.179e+04 6.870e-02 3.770e+03 2.763e-02 5.010e-02 2501 -2.530e+05 -2.530e+05
Path [27] :Best Iter: [36] ELBO (-2660.959056) evaluations: (2501)
Path [8] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.171e+04 3.795e-02 2.086e+04 1.359e-02 1.359e-02 2501 -1.294e+08 -1.294e+08
Path [8] :Best Iter: [24] ELBO (-2668.387047) evaluations: (2501)
Path [28] :Initial log joint density = -83829.698194
Path [14] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.169e+04 2.561e-02 2.064e+04 2.073e-02 2.073e-02 2501 -1.291e+06 -1.291e+06
Path [14] :Best Iter: [24] ELBO (-2675.773351) evaluations: (2501)
Path [2] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.172e+04 8.567e-02 1.377e+04 3.378e-02 3.378e-02 2501 -1.274e+05 -1.274e+05
Path [2] :Best Iter: [20] ELBO (-2684.724978) evaluations: (2501)
Path [9] :Initial log joint density = -83895.387942
Path [15] :Initial log joint density = -84198.280049
Path [3] :Initial log joint density = -84136.389030
Path [9] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.167e+04 1.691e-01 3.382e+04 5.851e-02 5.851e-02 2501 -2.783e+07 -2.783e+07
Path [9] :Best Iter: [28] ELBO (-2678.086048) evaluations: (2501)
Path [28] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.161e+04 2.844e-02 3.759e+04 3.491e-02 6.767e-02 2501 -8.926e+03 -8.926e+03
Path [28] :Best Iter: [17] ELBO (-2699.706420) evaluations: (2501)
Path [10] :Initial log joint density = -83937.660773
Path [29] :Initial log joint density = -84798.553017
Path [15] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.182e+04 9.102e-02 3.105e+03 2.234e-02 2.234e-02 2501 -1.237e+08 -1.237e+08
Path [15] :Best Iter: [47] ELBO (-2666.581270) evaluations: (2501)
Path [3] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.184e+04 2.797e-02 1.368e+03 2.776e-02 2.776e-02 2501 -1.757e+05 -1.757e+05
Path [3] :Best Iter: [49] ELBO (-2665.363534) evaluations: (2501)
Path [16] :Initial log joint density = -83987.229325
Path [4] :Initial log joint density = -84106.799928
Path [29] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.170e+04 1.332e-01 2.160e+04 4.131e-02 4.131e-02 2501 -6.777e+05 -6.777e+05
Path [29] :Best Iter: [18] ELBO (-2692.153215) evaluations: (2501)
Path [30] :Initial log joint density = -88416.438912
Path [10] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.182e+04 2.565e-02 3.118e+03 1.122e-02 1.122e-02 2501 -2.022e+06 -2.022e+06
Path [10] :Best Iter: [44] ELBO (-2658.210774) evaluations: (2501)
Path [11] :Initial log joint density = -90338.901641
Path [16] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.164e+04 7.146e-02 2.246e+04 4.058e-02 4.058e-02 2501 -6.220e+04 -6.220e+04
Path [16] :Best Iter: [23] ELBO (-2701.101560) evaluations: (2501)
Path [4] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.181e+04 1.229e-01 3.015e+03 3.600e-02 6.574e-02 2501 -6.009e+04 -6.009e+04
Path [4] :Best Iter: [39] ELBO (-2676.698220) evaluations: (2501)
Path [17] :Initial log joint density = -84000.145138
Path [5] :Initial log joint density = -84027.437931
Error evaluating model log probability: Non-finite gradient.
Path [30] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.171e+04 4.371e-02 1.085e+04 2.450e-02 2.450e-02 2501 -2.057e+04 -2.057e+04
Path [30] :Best Iter: [29] ELBO (-2679.431748) evaluations: (2501)
Path [31] :Initial log joint density = -84216.006546
Path [11] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.180e+04 9.237e-02 2.067e+03 2.649e-02 2.649e-02 2501 -1.171e+05 -1.171e+05
Path [11] :Best Iter: [44] ELBO (-2662.288568) evaluations: (2501)
Path [12] :Initial log joint density = -83925.756678
Path [17] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.168e+04 2.679e-02 2.447e+04 1.738e-02 1.738e-02 2501 -1.632e+05 -1.632e+05
Path [17] :Best Iter: [21] ELBO (-2688.901161) evaluations: (2501)
Path [5] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.163e+04 1.209e-01 3.904e+04 9.377e-02 9.377e-02 2501 -8.744e+03 -8.744e+03
Path [5] :Best Iter: [14] ELBO (-2687.437669) evaluations: (2501)
Path [18] :Initial log joint density = -92078.477959
Path [6] :Initial log joint density = -85985.804991
Path [31] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.167e+04 6.769e-02 2.167e+04 5.819e-02 5.819e-02 2501 -2.620e+05 -2.620e+05
Path [31] :Best Iter: [22] ELBO (-2672.589625) evaluations: (2501)
Path [32] :Initial log joint density = -85596.237930
Path [12] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.175e+04 8.569e-02 6.865e+03 3.934e-02 3.934e-02 2501 -2.970e+05 -2.970e+05
Path [12] :Best Iter: [33] ELBO (-2676.863491) evaluations: (2501)
Path [6] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.166e+04 4.173e-02 2.520e+04 1.878e-02 3.463e-02 2501 -1.600e+05 -1.600e+05
Path [6] :Best Iter: [25] ELBO (-2657.774038) evaluations: (2501)
Path [19] :Initial log joint density = -84132.522237
Path [18] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.182e+04 1.336e-01 2.525e+03 3.870e-02 3.870e-02 2501 -3.628e+07 -3.628e+07
Path [18] :Best Iter: [38] ELBO (-2676.075575) evaluations: (2501)
Path [24] :Initial log joint density = -84090.926267
Path [22] :Initial log joint density = -84060.241584
Path [32] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.182e+04 8.042e-02 3.279e+03 2.836e-02 2.836e-02 2501 -8.029e+04 -8.029e+04
Path [32] :Best Iter: [41] ELBO (-2661.444696) evaluations: (2501)
Path [33] :Initial log joint density = -84110.216283
Path [19] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.179e+04 6.938e-02 7.711e+03 1.231e-02 1.231e-02 2501 -1.084e+08 -1.084e+08
Path [19] :Best Iter: [38] ELBO (-2671.343361) evaluations: (2501)
Path [20] :Initial log joint density = -85029.599204
Path [22] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.168e+04 7.089e-02 2.040e+04 4.194e-02 4.194e-02 2501 -8.500e+05 -8.500e+05
Path [22] :Best Iter: [18] ELBO (-2681.036310) evaluations: (2501)
Path [24] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.173e+04 8.381e-02 1.162e+04 2.373e-02 4.484e-02 2501 -1.072e+05 -1.072e+05
Path [24] :Best Iter: [26] ELBO (-2676.430513) evaluations: (2501)
Path [23] :Initial log joint density = -84725.878520
Path [25] :Initial log joint density = -86010.691689
Path [33] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.175e+04 5.870e-02 7.246e+03 4.694e-02 4.694e-02 2501 -2.969e+04 -2.969e+04
Path [33] :Best Iter: [33] ELBO (-2668.512202) evaluations: (2501)
Path [34] :Initial log joint density = -83886.360781
Path [20] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.169e+04 4.182e-02 2.972e+04 3.411e-02 3.411e-02 2501 -2.913e+07 -2.913e+07
Path [20] :Best Iter: [25] ELBO (-2682.246788) evaluations: (2501)
Path [21] :Initial log joint density = -85632.551004
Path [23] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.169e+04 1.595e-02 2.342e+04 1.289e-02 1.289e-02 2501 -3.214e+04 -3.214e+04
Path [23] :Best Iter: [19] ELBO (-2685.846415) evaluations: (2501)
Path [25] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.178e+04 2.784e-02 3.786e+03 3.201e-02 3.201e-02 2501 -5.138e+03 -5.138e+03
Path [25] :Best Iter: [37] ELBO (-2656.366067) evaluations: (2501)
Path [38] :Initial log joint density = -85572.449506
Path [41] :Initial log joint density = -87473.636303
Path [44] :Initial log joint density = -83988.648642
Path [34] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.175e+04 1.915e-02 4.919e+03 2.505e-02 2.505e-02 2501 -1.414e+04 -1.414e+04
Path [34] :Best Iter: [32] ELBO (-2662.881675) evaluations: (2501)
Path [35] :Initial log joint density = -84820.100296
Path [41] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.166e+04 2.667e-02 2.225e+04 2.187e-02 2.187e-02 2501 -5.763e+06 -5.763e+06
Path [41] :Best Iter: [20] ELBO (-2679.783362) evaluations: (2501)
Path [44] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.169e+04 6.848e-02 2.833e+04 2.642e-02 4.924e-02 2501 -3.756e+05 -3.756e+05
Path [44] :Best Iter: [25] ELBO (-2664.323374) evaluations: (2501)
Path [38] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.167e+04 1.184e-01 1.672e+04 9.220e-02 9.220e-02 2501 -4.190e+04 -4.190e+04
Path [38] :Best Iter: [22] ELBO (-2672.937980) evaluations: (2501)
Path [42] :Initial log joint density = -84113.858197
Path [45] :Initial log joint density = -83952.653768
Path [35] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.173e+04 1.028e-01 1.523e+04 1.860e-02 1.860e-02 2501 -4.219e+05 -4.219e+05
Path [35] :Best Iter: [27] ELBO (-2687.383984) evaluations: (2501)
Path [21] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.164e+04 9.592e-02 4.121e+04 5.619e-02 5.619e-02 2501 -4.850e+04 -4.850e+04
Path [21] :Best Iter: [20] ELBO (-2679.059707) evaluations: (2501)
Path [36] :Initial log joint density = -84079.786284
Path [45] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.162e+04 1.244e-01 4.443e+04 4.057e-02 7.743e-02 2501 -5.335e+06 -5.335e+06
Path [45] :Best Iter: [16] ELBO (-2688.532585) evaluations: (2501)
Path [39] :Initial log joint density = -84028.231194
Path [42] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.174e+04 2.579e-02 1.604e+04 3.033e-02 3.033e-02 2501 -3.115e+04 -3.115e+04
Path [42] :Best Iter: [26] ELBO (-2670.052904) evaluations: (2501)
Path [46] :Initial log joint density = -86306.090952
Path [43] :Initial log joint density = -84070.980523
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Path [39] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.181e+04 8.381e-02 1.569e+03 6.958e-02 6.958e-02 2501 -3.651e+05 -3.651e+05
Path [39] :Best Iter: [42] ELBO (-2651.995083) evaluations: (2501)
Path [36] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.176e+04 1.044e-01 1.144e+04 2.407e-02 2.407e-02 2501 -2.091e+06 -2.091e+06
Path [36] :Best Iter: [27] ELBO (-2672.821978) evaluations: (2501)
Path [40] :Initial log joint density = -84121.195698
Path [37] :Initial log joint density = -84013.397197
Path [46] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.157e+04 1.885e-01 8.925e+04 6.011e-02 6.011e-02 2501 -1.137e+08 -1.137e+08
Path [46] :Best Iter: [20] ELBO (-2693.093684) evaluations: (2501)
Path [47] :Initial log joint density = -86924.647003
Path [43] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.187e+04 8.819e-02 1.517e+03 1.889e-02 1.889e-02 2501 -2.425e+06 -2.425e+06
Path [43] :Best Iter: [43] ELBO (-2649.437612) evaluations: (2501)
Path [49] :Initial log joint density = -84188.025806
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Path [40] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.165e+04 6.663e-02 4.890e+04 2.191e-02 2.191e-02 2501 -1.155e+06 -1.155e+06
Path [40] :Best Iter: [21] ELBO (-2683.457408) evaluations: (2501)
Path [37] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.178e+04 5.440e-02 2.574e+03 3.252e-02 3.252e-02 2501 -3.036e+04 -3.036e+04
Path [37] :Best Iter: [38] ELBO (-2652.155231) evaluations: (2501)
Path [50] :Initial log joint density = -83725.867265
Path [47] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.178e+04 4.207e-02 5.247e+03 1.674e-02 1.674e-02 2501 -3.778e+09 -3.778e+09
Path [47] :Best Iter: [39] ELBO (-2665.404963) evaluations: (2501)
Path [48] :Initial log joint density = -83972.295791
Path [49] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.181e+04 5.536e-02 5.258e+03 1.573e-02 1.573e-02 2501 -2.292e+07 -2.292e+07
Path [49] :Best Iter: [40] ELBO (-2669.059688) evaluations: (2501)
Path [50] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.166e+04 3.012e-02 3.033e+04 1.177e-02 1.177e-02 2501 -7.215e+14 -7.215e+14
Path [50] :Best Iter: [18] ELBO (-2676.172662) evaluations: (2501)
Path [48] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -8.177e+04 2.638e-02 5.191e+03 2.061e-02 2.061e-02 2501 -2.543e+04 -2.543e+04
Path [48] :Best Iter: [34] ELBO (-2665.337303) evaluations: (2501)
Total log probability function evaluations:127800
Finished in 5.6 seconds.
# Run post-model processing
sccomp_res <- sccomp_est %>%
sccomp_remove_outliers() %>%
sccomp_test(contrasts = "`DiagnosisNormal control` - `DiagnosisCrohn Disease`",
test_composition_above_logit_fold_change = 0.2)Running standalone generated quantities after 1 MCMC chain, with 12 thread(s) per chain...
Chain 1 finished in 0.0 seconds.
Path [32] :Initial log joint density = -76093.355182
Path [7] :Initial log joint density = -76222.465405Path [35] :Initial log joint density = -76082.226174
Path [29] :Initial log joint density = -76356.529135
Path [4] :Initial log joint density = -76286.238939
Path [10] :Initial log joint density = -76114.525505
Path [11] :Initial log joint density = -76750.860418
Path [13] :Initial log joint density = -76303.146677
Path [27] :Initial log joint density = -76188.100981
Path [2] :Initial log joint density = -78251.270422
Path [38] :Initial log joint density = -76510.784643
Path [8] :Initial log joint density = -76999.978317
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Path [2] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.373e+04 1.290e-01 3.042e+04 6.755e-02 6.755e-02 2501 -1.090e+04 -1.090e+04
Path [2] :Best Iter: [18] ELBO (-2611.203179) evaluations: (2501)
Path [11] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.386e+04 5.309e-02 3.242e+03 1.383e-02 1.383e-02 2501 -4.225e+05 -4.225e+05
Path [11] :Best Iter: [39] ELBO (-2580.064091) evaluations: (2501)
Path [3] :Initial log joint density = -76005.582068
Path [8] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.382e+04 8.484e-02 6.421e+03 5.194e-02 5.194e-02 2501 -2.136e+04 -2.136e+04
Path [8] :Best Iter: [22] ELBO (-2605.871041) evaluations: (2501)
Path [32] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.388e+04 6.007e-02 1.705e+03 5.664e-02 5.664e-02 2501 -3.040e+04 -3.040e+04
Path [32] :Best Iter: [43] ELBO (-2574.218921) evaluations: (2501)
Path [29] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.378e+04 5.815e-02 1.502e+04 3.331e-02 3.331e-02 2501 -1.835e+04 -1.835e+04
Path [29] :Best Iter: [27] ELBO (-2594.792959) evaluations: (2501)
Path [4] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.389e+04 7.642e-02 2.920e+03 2.794e-02 2.794e-02 2501 -2.110e+06 -2.110e+06
Path [4] :Best Iter: [43] ELBO (-2581.354492) evaluations: (2501)
Path [27] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.388e+04 1.745e-01 3.593e+03 3.188e-02 3.188e-02 2501 -3.100e+06 -3.100e+06
Path [27] :Best Iter: [40] ELBO (-2575.516578) evaluations: (2501)
Path [12] :Initial log joint density = -76129.244319
Path [35] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.390e+04 1.359e-02 1.647e+03 1.257e-02 1.257e-02 2501 -1.047e+04 -1.047e+04
Path [35] :Best Iter: [43] ELBO (-2566.724233) evaluations: (2501)
Path [13] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.378e+04 1.358e-01 1.874e+04 7.354e-02 7.354e-02 2501 -3.832e+04 -3.832e+04
Path [13] :Best Iter: [21] ELBO (-2603.012206) evaluations: (2501)
Path [36] :Initial log joint density = -75921.327418
Path [10] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.389e+04 5.597e-02 2.713e+03 2.568e-02 2.568e-02 2501 -1.907e+04 -1.907e+04
Path [10] :Best Iter: [41] ELBO (-2582.204567) evaluations: (2501)
Path [9] :Initial log joint density = -81633.870051
Path [33] :Initial log joint density = -79586.992375
Path [5] :Initial log joint density = -76328.185399
Path [28] :Initial log joint density = -76066.518544
Path [38] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.376e+04 8.834e-02 3.477e+04 1.927e-02 6.609e-02 2501 -5.693e+11 -5.693e+11
Path [38] :Best Iter: [17] ELBO (-2602.027303) evaluations: (2501)
Path [30] :Initial log joint density = -79262.657866
Path [7] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.388e+04 1.683e-01 4.979e+03 3.774e-02 3.774e-02 2501 -6.167e+05 -6.167e+05
Path [7] :Best Iter: [37] ELBO (-2584.443634) evaluations: (2501)
Path [14] :Initial log joint density = -75998.597597
Path [26] :Initial log joint density = -76499.676052
Path [39] :Initial log joint density = -75990.276634
Path [44] :Initial log joint density = -77085.287831
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Path [3] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.387e+04 7.787e-02 3.647e+03 5.607e-02 5.607e-02 2501 -1.071e+04 -1.071e+04
Path [3] :Best Iter: [39] ELBO (-2593.564569) evaluations: (2501)
Path [12] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.372e+04 2.165e-01 3.829e+04 1.100e-01 1.100e-01 2501 -6.292e+03 -6.292e+03
Path [12] :Best Iter: [19] ELBO (-2605.528649) evaluations: (2501)
Path [40] :Initial log joint density = -76695.126752
Path [41] :Initial log joint density = -75970.431929
Path [42] :Initial log joint density = -76348.742546
Path [36] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.369e+04 5.713e-02 2.133e+04 4.454e-02 4.454e-02 2501 -4.689e+04 -4.689e+04
Path [36] :Best Iter: [15] ELBO (-2615.505381) evaluations: (2501)
Path [30] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.372e+04 1.994e-02 1.802e+04 6.428e-02 6.428e-02 2501 -6.132e+03 -6.132e+03
Path [30] :Best Iter: [20] ELBO (-2594.059240) evaluations: (2501)
Path [28] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.388e+04 1.563e-01 2.160e+03 3.094e-02 3.094e-02 2501 -7.244e+05 -7.244e+05
Path [28] :Best Iter: [38] ELBO (-2573.790484) evaluations: (2501)
Path [5] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.383e+04 8.330e-02 3.814e+03 3.014e-02 3.014e-02 2501 -4.391e+05 -4.391e+05
Path [5] :Best Iter: [32] ELBO (-2588.188651) evaluations: (2501)
Path [37] :Initial log joint density = -79496.420812
Path [44] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.373e+04 8.749e-02 3.108e+04 7.274e-02 7.274e-02 2501 -1.028e+04 -1.028e+04
Path [44] :Best Iter: [20] ELBO (-2597.948981) evaluations: (2501)
Path [39] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.389e+04 6.932e-02 2.447e+03 3.063e-02 3.063e-02 2501 -1.576e+05 -1.576e+05
Path [39] :Best Iter: [44] ELBO (-2576.036977) evaluations: (2501)
Path [14] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.376e+04 2.462e-01 1.756e+04 8.779e-02 8.779e-02 2501 -1.491e+05 -1.491e+05
Path [14] :Best Iter: [23] ELBO (-2600.474189) evaluations: (2501)
Path [31] :Initial log joint density = -76034.968937
Path [26] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.375e+04 1.683e-01 1.336e+04 6.753e-02 6.753e-02 2501 -4.375e+04 -4.375e+04
Path [26] :Best Iter: [22] ELBO (-2591.343285) evaluations: (2501)
Path [6] :Initial log joint density = -76035.868981
Path [45] :Initial log joint density = -75998.810474
Path [19] :Initial log joint density = -76686.440507
Path [1] :Initial log joint density = -76883.444679
Path [15] :Initial log joint density = -76883.623222
Path [22] :Initial log joint density = -76101.593191
Path [33] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.388e+04 5.297e-02 2.269e+03 2.351e-02 2.351e-02 2501 -2.755e+05 -2.755e+05
Path [33] :Best Iter: [44] ELBO (-2574.732290) evaluations: (2501)
Path [34] :Initial log joint density = -77073.103507
Path [40] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.380e+04 7.809e-02 1.653e+04 2.165e-02 3.776e-02 2501 -5.399e+06 -5.399e+06
Path [40] :Best Iter: [19] ELBO (-2605.121458) evaluations: (2501)
Path [43] :Initial log joint density = -76325.321424
Path [42] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.387e+04 8.689e-02 1.659e+03 3.094e-02 3.094e-02 2501 -1.290e+05 -1.290e+05
Path [42] :Best Iter: [44] ELBO (-2584.892894) evaluations: (2501)
Path [15] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.376e+04 6.163e-02 2.033e+04 5.331e-02 1.282e-01 2501 -5.045e+04 -5.045e+04
Path [15] :Best Iter: [20] ELBO (-2616.009617) evaluations: (2501)
Path [37] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.388e+04 7.528e-02 2.920e+03 3.366e-02 3.366e-02 2501 -1.398e+04 -1.398e+04
Path [37] :Best Iter: [48] ELBO (-2583.039386) evaluations: (2501)
Path [16] :Initial log joint density = -76336.869744
Path [31] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.377e+04 8.161e-02 1.279e+04 4.838e-02 4.838e-02 2501 -3.566e+04 -3.566e+04
Path [31] :Best Iter: [23] ELBO (-2604.846191) evaluations: (2501)
Path [45] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.390e+04 2.180e-01 1.988e+03 3.093e-02 3.093e-02 2501 -1.835e+07 -1.835e+07
Path [45] :Best Iter: [50] ELBO (-2578.195479) evaluations: (2501)
Path [47] :Initial log joint density = -76172.247253
Path [19] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.378e+04 6.097e-02 7.908e+03 5.704e-02 5.704e-02 2501 -3.600e+03 -3.600e+03
Path [19] :Best Iter: [15] ELBO (-2590.136782) evaluations: (2501)
Path [17] :Initial log joint density = -76259.926420
Path [46] :Initial log joint density = -76283.899935
Path [24] :Initial log joint density = -76017.458761
Path [18] :Initial log joint density = -78885.315558
Path [20] :Initial log joint density = -76056.494315
Path [49] :Initial log joint density = -76061.713596
Path [50] :Initial log joint density = -76156.554640
Path [25] :Initial log joint density = -76025.014517
Path [1] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.387e+04 7.548e-02 3.897e+03 2.894e-02 2.894e-02 2501 -2.029e+05 -2.029e+05
Path [1] :Best Iter: [38] ELBO (-2585.507262) evaluations: (2501)
Path [21] :Initial log joint density = -76099.854888
Path [34] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.383e+04 1.356e-01 9.991e+03 5.012e-02 5.012e-02 2501 -6.595e+04 -6.595e+04
Path [34] :Best Iter: [32] ELBO (-2584.236811) evaluations: (2501)
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Path [43] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.384e+04 4.969e-02 3.492e+03 2.582e-02 2.582e-02 2501 -1.697e+05 -1.697e+05
Path [43] :Best Iter: [36] ELBO (-2566.834624) evaluations: (2501)
Path [47] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.385e+04 3.040e-02 1.650e+03 1.369e-02 1.369e-02 2501 -2.769e+06 -2.769e+06
Path [47] :Best Iter: [42] ELBO (-2564.941101) evaluations: (2501)
Path [46] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.388e+04 9.779e-02 3.336e+03 2.443e-02 2.443e-02 2501 -1.297e+06 -1.297e+06
Path [46] :Best Iter: [38] ELBO (-2582.727978) evaluations: (2501)
Path [48] :Initial log joint density = -76050.644312
Path [18] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.385e+04 1.359e-01 3.103e+03 3.622e-02 3.622e-02 2501 -9.798e+04 -9.798e+04
Path [18] :Best Iter: [32] ELBO (-2574.635547) evaluations: (2501)
Path [24] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.368e+04 8.098e-02 4.642e+04 2.839e-02 5.135e-02 2501 -3.862e+04 -3.862e+04
Path [24] :Best Iter: [20] ELBO (-2589.678609) evaluations: (2501)
Path [25] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.378e+04 6.673e-02 1.815e+04 1.541e-02 1.541e-02 2501 -4.348e+06 -4.348e+06
Path [25] :Best Iter: [26] ELBO (-2584.977519) evaluations: (2501)
Path [49] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.370e+04 2.970e-02 3.250e+04 4.245e-02 4.245e-02 2501 -1.451e+04 -1.451e+04
Path [49] :Best Iter: [16] ELBO (-2612.903079) evaluations: (2501)
Path [50] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.382e+04 6.633e-02 7.132e+03 1.612e-02 3.660e-02 2501 -1.608e+05 -1.608e+05
Path [50] :Best Iter: [30] ELBO (-2587.157249) evaluations: (2501)
Path [21] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.380e+04 8.353e-02 2.334e+04 1.019e-02 1.019e-02 2501 -4.122e+10 -4.122e+10
Path [21] :Best Iter: [30] ELBO (-2589.584630) evaluations: (2501)
Path [6] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.388e+04 7.894e-02 5.470e+03 2.309e-02 2.309e-02 2501 -4.707e+05 -4.707e+05
Path [6] :Best Iter: [46] ELBO (-2581.379704) evaluations: (2501)
Path [22] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.387e+04 1.753e-01 2.963e+03 2.366e-02 2.366e-02 2501 -3.842e+05 -3.842e+05
Path [22] :Best Iter: [42] ELBO (-2563.043111) evaluations: (2501)
Path [23] :Initial log joint density = -76133.704925
Path [48] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.372e+04 6.285e-02 4.286e+04 2.178e-02 5.927e-02 2501 -3.406e+04 -3.406e+04
Path [48] :Best Iter: [21] ELBO (-2592.991236) evaluations: (2501)
Path [16] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.389e+04 4.459e-02 2.144e+03 3.295e-02 3.295e-02 2501 -1.511e+05 -1.511e+05
Path [16] :Best Iter: [39] ELBO (-2573.156322) evaluations: (2501)
Path [17] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.371e+04 4.820e-02 1.802e+04 2.772e-02 2.772e-02 2501 -1.197e+06 -1.197e+06
Path [17] :Best Iter: [23] ELBO (-2610.000487) evaluations: (2501)
Path [20] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.363e+04 7.030e-02 8.371e+04 3.179e-02 3.179e-02 2501 -1.928e+04 -1.928e+04
Path [20] :Best Iter: [19] ELBO (-2599.133703) evaluations: (2501)
Path [41] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.382e+04 1.015e-01 7.924e+03 2.686e-02 2.686e-02 2501 -5.418e+08 -5.418e+08
Path [41] :Best Iter: [38] ELBO (-2589.609401) evaluations: (2501)
Path [23] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.378e+04 3.464e-02 1.250e+04 3.963e-02 3.963e-02 2501 -6.317e+04 -6.317e+04
Path [23] :Best Iter: [23] ELBO (-2593.723168) evaluations: (2501)
Path [9] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.363e+04 9.395e-02 1.087e+05 3.027e-02 5.157e-02 2501 -3.316e+04 -3.316e+04
Path [9] :Best Iter: [21] ELBO (-2612.798729) evaluations: (2501)
Total log probability function evaluations:138750
Finished in 6.1 seconds.
Running standalone generated quantities after 1 MCMC chain, with 12 thread(s) per chain...
Chain 1 finished in 0.0 seconds.
Path [1] :Initial log joint density = -76883.444679
Path [2] :Initial log joint density = -78251.270422Path [27] :Initial log joint density = -76188.100981
Path [29] :Initial log joint density = -76356.529135Path [7] :Initial log joint density = -76222.465405
Path [26] :Initial log joint density = -76499.676052
Path [8] :Initial log joint density = -76999.978317
Path [13] :Initial log joint density = -76303.146677
Path [32] :Initial log joint density = -76093.355182
Path [38] :Initial log joint density = -76510.784643
Path [4] :Initial log joint density = -76286.238939
Path [10] :Initial log joint density = -76114.525505
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Path [10] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.389e+04 5.597e-02 2.713e+03 2.568e-02 2.568e-02 2501 -1.907e+04 -1.907e+04
Path [10] :Best Iter: [41] ELBO (-2582.204567) evaluations: (2501)
Path [11] :Initial log joint density = -76750.860418
Path [8] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.382e+04 8.484e-02 6.421e+03 5.194e-02 5.194e-02 2501 -2.136e+04 -2.136e+04
Path [8] :Best Iter: [22] ELBO (-2605.871041) evaluations: (2501)
Path [1] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.387e+04 7.548e-02 3.897e+03 2.894e-02 2.894e-02 2501 -2.029e+05 -2.029e+05
Path [1] :Best Iter: [38] ELBO (-2585.507262) evaluations: (2501)
Path [26] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.375e+04 1.683e-01 1.336e+04 6.753e-02 6.753e-02 2501 -4.375e+04 -4.375e+04
Path [26] :Best Iter: [22] ELBO (-2591.343285) evaluations: (2501)
Path [9] :Initial log joint density = -81633.870051
Path [27] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.388e+04 1.745e-01 3.593e+03 3.188e-02 3.188e-02 2501 -3.100e+06 -3.100e+06
Path [27] :Best Iter: [40] ELBO (-2575.516578) evaluations: (2501)
Path [28] :Initial log joint density = -76066.518544
Path [19] :Initial log joint density = -76686.440507
Path [30] :Initial log joint density = -79262.657866
Path [38] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.376e+04 8.834e-02 3.477e+04 1.927e-02 6.609e-02 2501 -5.693e+11 -5.693e+11
Path [38] :Best Iter: [17] ELBO (-2602.027303) evaluations: (2501)
Path [32] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.388e+04 6.007e-02 1.705e+03 5.664e-02 5.664e-02 2501 -3.040e+04 -3.040e+04
Path [32] :Best Iter: [43] ELBO (-2574.218921) evaluations: (2501)
Path [2] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.373e+04 1.290e-01 3.042e+04 6.755e-02 6.755e-02 2501 -1.090e+04 -1.090e+04
Path [2] :Best Iter: [18] ELBO (-2611.203179) evaluations: (2501)
Path [39] :Initial log joint density = -75990.276634
Path [33] :Initial log joint density = -79586.992375
Path [4] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.389e+04 7.642e-02 2.920e+03 2.794e-02 2.794e-02 2501 -2.110e+06 -2.110e+06
Path [4] :Best Iter: [43] ELBO (-2581.354492) evaluations: (2501)
Path [3] :Initial log joint density = -76005.582068
Path [5] :Initial log joint density = -76328.185399
Path [7] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.388e+04 1.683e-01 4.979e+03 3.774e-02 3.774e-02 2501 -6.167e+05 -6.167e+05
Path [7] :Best Iter: [37] ELBO (-2584.443634) evaluations: (2501)
Path [35] :Initial log joint density = -76082.226174
Path [29] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.378e+04 5.815e-02 1.502e+04 3.331e-02 3.331e-02 2501 -1.835e+04 -1.835e+04
Path [29] :Best Iter: [27] ELBO (-2594.792959) evaluations: (2501)
Path [31] :Initial log joint density = -76034.968937
Path [13] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.378e+04 1.358e-01 1.874e+04 7.354e-02 7.354e-02 2501 -3.832e+04 -3.832e+04
Path [13] :Best Iter: [21] ELBO (-2603.012206) evaluations: (2501)
Path [14] :Initial log joint density = -75998.597597
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Path [11] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.386e+04 5.309e-02 3.242e+03 1.383e-02 1.383e-02 2501 -4.225e+05 -4.225e+05
Path [11] :Best Iter: [39] ELBO (-2580.064091) evaluations: (2501)
Path [33] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.388e+04 5.297e-02 2.269e+03 2.351e-02 2.351e-02 2501 -2.755e+05 -2.755e+05
Path [33] :Best Iter: [44] ELBO (-2574.732290) evaluations: (2501)
Path [19] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.378e+04 6.097e-02 7.908e+03 5.704e-02 5.704e-02 2501 -3.600e+03 -3.600e+03
Path [19] :Best Iter: [15] ELBO (-2590.136782) evaluations: (2501)
Path [34] :Initial log joint density = -77073.103507
Path [12] :Initial log joint density = -76129.244319
Path [30] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.372e+04 1.994e-02 1.802e+04 6.428e-02 6.428e-02 2501 -6.132e+03 -6.132e+03
Path [30] :Best Iter: [20] ELBO (-2594.059240) evaluations: (2501)
Path [9] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.363e+04 9.395e-02 1.087e+05 3.027e-02 5.157e-02 2501 -3.316e+04 -3.316e+04
Path [9] :Best Iter: [21] ELBO (-2612.798729) evaluations: (2501)
Path [22] :Initial log joint density = -76101.593191
Path [44] :Initial log joint density = -77085.287831
Path [28] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.388e+04 1.563e-01 2.160e+03 3.094e-02 3.094e-02 2501 -7.244e+05 -7.244e+05
Path [28] :Best Iter: [38] ELBO (-2573.790484) evaluations: (2501)
Path [20] :Initial log joint density = -76056.494315
Path [31] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.377e+04 8.161e-02 1.279e+04 4.838e-02 4.838e-02 2501 -3.566e+04 -3.566e+04
Path [31] :Best Iter: [23] ELBO (-2604.846191) evaluations: (2501)
Path [6] :Initial log joint density = -76035.868981
Path [36] :Initial log joint density = -75921.327418
Path [5] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.383e+04 8.330e-02 3.814e+03 3.014e-02 3.014e-02 2501 -4.391e+05 -4.391e+05
Path [5] :Best Iter: [32] ELBO (-2588.188651) evaluations: (2501)
Path [3] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.387e+04 7.787e-02 3.647e+03 5.607e-02 5.607e-02 2501 -1.071e+04 -1.071e+04
Path [3] :Best Iter: [39] ELBO (-2593.564569) evaluations: (2501)
Path [41] :Initial log joint density = -75970.431929
Path [47] :Initial log joint density = -76172.247253
Path [16] :Initial log joint density = -76336.869744
Path [39] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.389e+04 6.932e-02 2.447e+03 3.063e-02 3.063e-02 2501 -1.576e+05 -1.576e+05
Path [39] :Best Iter: [44] ELBO (-2576.036977) evaluations: (2501)
Path [35] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.390e+04 1.359e-02 1.647e+03 1.257e-02 1.257e-02 2501 -1.047e+04 -1.047e+04
Path [35] :Best Iter: [43] ELBO (-2566.724233) evaluations: (2501)
Path [40] :Initial log joint density = -76695.126752
Path [42] :Initial log joint density = -76348.742546
Path [14] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.376e+04 2.462e-01 1.756e+04 8.779e-02 8.779e-02 2501 -1.491e+05 -1.491e+05
Path [14] :Best Iter: [23] ELBO (-2600.474189) evaluations: (2501)
Path [15] :Initial log joint density = -76883.623222
Path [22] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.387e+04 1.753e-01 2.963e+03 2.366e-02 2.366e-02 2501 -3.842e+05 -3.842e+05
Path [22] :Best Iter: [42] ELBO (-2563.043111) evaluations: (2501)
Path [36] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.369e+04 5.713e-02 2.133e+04 4.454e-02 4.454e-02 2501 -4.689e+04 -4.689e+04
Path [36] :Best Iter: [15] ELBO (-2615.505381) evaluations: (2501)
Path [23] :Initial log joint density = -76133.704925
Path [44] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.373e+04 8.749e-02 3.108e+04 7.274e-02 7.274e-02 2501 -1.028e+04 -1.028e+04
Path [44] :Best Iter: [20] ELBO (-2597.948981) evaluations: (2501)
Path [42] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.387e+04 8.689e-02 1.659e+03 3.094e-02 3.094e-02 2501 -1.290e+05 -1.290e+05
Path [42] :Best Iter: [44] ELBO (-2584.892894) evaluations: (2501)
Path [43] :Initial log joint density = -76325.321424
Path [45] :Initial log joint density = -75998.810474
Path [20] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.363e+04 7.029e-02 8.371e+04 3.179e-02 3.179e-02 2501 -1.928e+04 -1.928e+04
Path [20] :Best Iter: [19] ELBO (-2599.133703) evaluations: (2501)
Path [21] :Initial log joint density = -76099.854888
Path [41] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.382e+04 1.015e-01 7.924e+03 2.686e-02 2.686e-02 2501 -5.418e+08 -5.418e+08
Path [41] :Best Iter: [38] ELBO (-2589.609401) evaluations: (2501)
Path [16] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.389e+04 4.459e-02 2.144e+03 3.295e-02 3.295e-02 2501 -1.511e+05 -1.511e+05
Path [16] :Best Iter: [39] ELBO (-2573.156322) evaluations: (2501)
Path [47] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.385e+04 3.040e-02 1.650e+03 1.369e-02 1.369e-02 2501 -2.769e+06 -2.769e+06
Path [47] :Best Iter: [42] ELBO (-2564.941101) evaluations: (2501)
Path [37] :Initial log joint density = -79496.420812
Path [17] :Initial log joint density = -76259.926420
Path [15] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.376e+04 6.163e-02 2.033e+04 5.331e-02 1.282e-01 2501 -5.045e+04 -5.045e+04
Path [15] :Best Iter: [20] ELBO (-2616.009617) evaluations: (2501)
Path [48] :Initial log joint density = -76050.644312
Path [49] :Initial log joint density = -76061.713596
Path [6] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.388e+04 7.894e-02 5.470e+03 2.309e-02 2.309e-02 2501 -4.707e+05 -4.707e+05
Path [6] :Best Iter: [46] ELBO (-2581.379704) evaluations: (2501)
Path [46] :Initial log joint density = -76283.899935
Path [40] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.380e+04 7.809e-02 1.653e+04 2.165e-02 3.776e-02 2501 -5.399e+06 -5.399e+06
Path [40] :Best Iter: [19] ELBO (-2605.121458) evaluations: (2501)
Path [18] :Initial log joint density = -78885.315558
Path [24] :Initial log joint density = -76017.458761
Path [34] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.383e+04 1.356e-01 9.991e+03 5.012e-02 5.012e-02 2501 -6.595e+04 -6.595e+04
Path [34] :Best Iter: [32] ELBO (-2584.236811) evaluations: (2501)
Path [25] :Initial log joint density = -76025.014517
Path [50] :Initial log joint density = -76156.554640
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Error evaluating model log probability: Non-finite gradient.
Path [43] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.384e+04 4.969e-02 3.492e+03 2.582e-02 2.582e-02 2501 -1.697e+05 -1.697e+05
Path [43] :Best Iter: [36] ELBO (-2566.834624) evaluations: (2501)
Path [17] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.371e+04 4.820e-02 1.802e+04 2.772e-02 2.772e-02 2501 -1.197e+06 -1.197e+06
Path [17] :Best Iter: [23] ELBO (-2610.000487) evaluations: (2501)
Path [23] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.378e+04 3.464e-02 1.250e+04 3.963e-02 3.963e-02 2501 -6.317e+04 -6.317e+04
Path [23] :Best Iter: [23] ELBO (-2593.723168) evaluations: (2501)
Path [45] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.390e+04 2.180e-01 1.988e+03 3.093e-02 3.093e-02 2501 -1.835e+07 -1.835e+07
Path [45] :Best Iter: [50] ELBO (-2578.195479) evaluations: (2501)
Path [24] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.368e+04 8.098e-02 4.642e+04 2.839e-02 5.135e-02 2501 -3.862e+04 -3.862e+04
Path [24] :Best Iter: [20] ELBO (-2589.678609) evaluations: (2501)
Path [48] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.372e+04 6.285e-02 4.286e+04 2.178e-02 5.927e-02 2501 -3.406e+04 -3.406e+04
Path [48] :Best Iter: [21] ELBO (-2592.991236) evaluations: (2501)
Path [46] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.388e+04 9.779e-02 3.336e+03 2.443e-02 2.443e-02 2501 -1.297e+06 -1.297e+06
Path [46] :Best Iter: [38] ELBO (-2582.727978) evaluations: (2501)
Path [18] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.385e+04 1.359e-01 3.103e+03 3.622e-02 3.622e-02 2501 -9.798e+04 -9.798e+04
Path [18] :Best Iter: [32] ELBO (-2574.635547) evaluations: (2501)
Path [49] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.370e+04 2.970e-02 3.250e+04 4.245e-02 4.245e-02 2501 -1.450e+04 -1.450e+04
Path [49] :Best Iter: [16] ELBO (-2612.903079) evaluations: (2501)
Path [25] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.378e+04 6.673e-02 1.815e+04 1.541e-02 1.541e-02 2501 -4.348e+06 -4.348e+06
Path [25] :Best Iter: [26] ELBO (-2584.977519) evaluations: (2501)
Path [50] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.382e+04 6.633e-02 7.132e+03 1.612e-02 3.660e-02 2501 -1.608e+05 -1.608e+05
Path [50] :Best Iter: [30] ELBO (-2587.157249) evaluations: (2501)
Path [12] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.372e+04 2.165e-01 3.829e+04 1.100e-01 1.100e-01 2501 -6.292e+03 -6.292e+03
Path [12] :Best Iter: [19] ELBO (-2605.528649) evaluations: (2501)
Path [37] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.388e+04 7.529e-02 2.920e+03 3.366e-02 3.366e-02 2501 -1.398e+04 -1.398e+04
Path [37] :Best Iter: [48] ELBO (-2583.039386) evaluations: (2501)
Path [21] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
100 -7.380e+04 8.353e-02 2.334e+04 1.019e-02 1.019e-02 2501 -4.122e+10 -4.122e+10
Path [21] :Best Iter: [30] ELBO (-2589.584630) evaluations: (2501)
Total log probability function evaluations:127800
Finished in 3.8 seconds.
The plotting methods don’t work well in the sccomp package. I recommend using the data to make plots directly. A familiar plot for differential tests is the volcano plot.
EnhancedVolcano(sccomp_res,
x = "c_effect",
y = "c_FDR",
lab = sccomp_res$annotation_V2,
pCutoff = 0.05,
title = "sccomp differential composition annotation_V2 vs. Normal",
subtitle = "p-val is FDR. FDR cutoff = 0.05; annotation_V2 positive, Normal negative")In sccomp, a differential composition “c” and differential variability “v” are both calculated between groups. We can plot each of these separately as well
sccomp_res <- sccomp_res %>%
mutate(signif = ifelse(c_FDR < 0.05, "FDR < 0.05", "FDR >= 0.05")) %>% arrange(c_effect)
ggplot(sccomp_res, aes(y = factor(annotation_V2,levels=annotation_V2), x = c_effect)) +
geom_segment(aes(y = annotation_V2,
yend = annotation_V2,
x = c_lower,
xend = c_upper,
color = signif),
size = 1) +
geom_point(size = 3) + # Add point at c_effect
scale_color_manual(values = c("FDR < 0.05" = "red3", "FDR >= 0.05" = "black")) +
theme_minimal(base_size = 16) +
labs(title = "Composition test intervals with FDR",
x = "Log-fold-change",
y = "annotation_V2") +
theme(axis.text.x = element_text(angle = 45, hjust = 1),
legend.title = element_blank()) # Improve x-axis labels readabilitysccomp_res <- sccomp_res %>%
mutate(signif = ifelse(v_FDR < 0.05, "FDR < 0.05", "FDR >= 0.05")) %>% arrange(v_effect)
ggplot(sccomp_res, aes(y = factor(annotation_V2,levels=annotation_V2), x = v_effect)) +
geom_segment(aes(y = annotation_V2,
yend = annotation_V2,
x = v_lower,
xend = v_upper,
color = signif),
size = 1) +
geom_point(size = 3) + # Add point at c_effect
scale_color_manual(values = c("FDR < 0.05" = "red3", "FDR >= 0.05" = "black")) +
theme_minimal(base_size = 16) +
labs(title = "Variability test intervals with FDR",
x = "Difference in Variance",
y = "annotation_V2") +
theme(axis.text.x = element_text(angle = 45, hjust = 1),
legend.title = element_blank()) # Improve x-axis labels readabilityWhen there are many cell states in a dataset, for example in a large dataset, it can be nice to make a volcano plot of results for interpretability, so here we include code for creating a nice looking one based on sccomp results
Comparing samples with compositions
PCA
comp_ls <- list("alr" = alrTb, "clr" = clrTb, "raw" = rawTb, "pct" = pctTb)
# Run PCA on each transformation
pca_ls <- lapply(names(comp_ls), function(i) {
print(i)
tmp <- comp_ls[[i]]
PCA <- tmp[-which(colnames(tmp) %in% c("sample", "group"))] %>%
prcomp()
})[1] "alr"
[1] "clr"
[1] "raw"
[1] "pct"
names(pca_ls) <- names(comp_ls)
# Extract data of interest from each transformation
pcaDF <- lapply(names(pca_ls), function(i) {
# Return dataframe
data.frame(
pca_ls[[i]]$x,
sample_id = comp_ls[[i]]$sample,
transform = i)
}) %>%
bind_rows()
# add total number of cells per sample to the PCA for illustration
total_cells <- se@meta.data %>%
count(sample_id, Diagnosis) %>%
rename(total_cells = n, sample_id=sample_id)
pcaDF <- pcaDF %>% left_join(total_cells)
ggplot(pcaDF, aes(x = PC1, y = PC2, color = Diagnosis, label = sample_id)) +
geom_point(size=4) +
geom_text_repel() +
facet_wrap(~ transform, scales = "free") +
labs(title = "PCA Across Transformations") +
theme_linedraw(base_size = 20) +
theme(axis.text.x = element_text(angle = 45, hjust = 1),
legend.position = "bottom") +
guides(fill = guide_legend(title = "P-value < 0.05")) +
scale_color_manual(values = c("red", "green"))ggplot(pcaDF, aes(x = PC1, y = PC2, color = total_cells, label = sample_id)) +
geom_point(size=4) +
geom_text_repel() +
facet_wrap(~ transform, scales = "free") +
labs(title = "PCA colored by total cell number") +
theme_linedraw(base_size = 20) +
theme(axis.text.x = element_text(angle = 45, hjust = 1),
legend.text = element_text(angle = 45, hjust = 1),
legend.position = "bottom") +
scale_color_gradient(low = 'turquoise', high = 'royalblue')loadingsDF <- lapply(names(pca_ls), function(i) {
data.frame(
pca_ls[[i]]$rotation,
transform = i)
}) %>%
bind_rows() %>%
rownames_to_column('species') %>%
group_by(transform) %>%
arrange(PC1)
loadingsDF %>%
ggplot(
aes(x = PC1, y = factor(species, levels = loadingsDF$species),
fill = PC1 < 0)) +
geom_bar(stat = 'identity') +
facet_wrap(.~transform, scales = 'free') +
theme_linedraw(base_size = 20) +
scale_fill_manual(values = unname(pal[c(6, 11)])) #+ # scale_y_discrete(labels = function(x) str_replace_all(x, '\\.\\.\\.(.*)',''))Distances between samples
We can also directly calculate distances between samples based on sample composition space. This can give us a better idea about outliers and how samples group together. We can also use any of the clustering metrics to test coherence of groups.
In compositional analysis, the method for calculating distances between samples proposed by John Aitchison [@aitchison_concise_2005] remains the a popular method. Termed Aitchison Distance, it is the Euclidean distance between samples based on CLR transformed counts of species.
clr_distances <- clrTb %>%
mutate(sample_group = glue::glue("{sample}_{group}")) %>%
column_to_rownames("sample_group") %>%
select(-c(group, sample)) %>%
dist(method = "euclidean")
distdf <- reshape2::melt(as.matrix(clr_distances), varnames = c("from", "to"))
datatable(distdf)distlong <- distdf %>%
separate(from, c('sample1', 'group1'), sep = '_', remove = FALSE) %>%
separate(to, c('sample2', 'group2'), sep = '_', remove = FALSE)
distlong %>%
filter(sample1 != sample2) %>%
mutate(
distance_group = case_when(
str_detect(group1, "Normal") & str_detect(group2, "Normal") ~ "between healthy",
str_detect(group1, "Normal") & str_detect(group2, "Crohn") ~ 'between Normal and CD',
str_detect(group1, "Crohn") & str_detect(group2, "Normal") ~ 'between Normal and CD',
str_detect(group1, "Crohn") & str_detect(group2, "Crohn") ~ 'between CD'
)) %>%
ggplot(aes(x=value,fill=distance_group)) +
geom_density(alpha=0.4) +
ggtitle('Aitchison Distances between and within groups') +
theme_bw(base_size = 20) +
xlab('euclidean distance')heatmap_metadata <- pcaDF %>%
dplyr::select(sample_id, Diagnosis) %>%
distinct
color_gradient <- colorRampPalette(c("#eff817", "#fe1b07"))(100)
unnamed_pal <- unname(pal)
ha <- HeatmapAnnotation(df = as.data.frame(heatmap_metadata[, c("sample_id", "Diagnosis")]),
col = list(Diagnosis = c("Crohn Disease" = "red", "Normal control" = "green"),
sample_id = donor_pal),
which = "column")
ComplexHeatmap::Heatmap(as.matrix(clr_distances),
name = "Aitchison Distance",
col = color_gradient,
top_annotation = ha,
clustering_distance_rows = "euclidean",
clustering_distance_columns = "euclidean")Session Info
sessionInfo()R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS 15.3.1
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: America/New_York
tzcode source: internal
attached base packages:
[1] grid stats graphics grDevices utils datasets methods base
other attached packages:
[1] sccomp_2.1.5 ComplexHeatmap_2.18.0 reshape2_1.4.4 compositions_2.0-8 Seurat_5.2.1 SeuratObject_5.0.2 sp_2.1-4 DT_0.33 scales_1.3.0 viridis_0.6.5 viridisLite_0.4.2 EnhancedVolcano_1.20.0 ggrepel_0.9.6 lubridate_1.9.4 forcats_1.0.0 stringr_1.5.1 dplyr_1.1.4 purrr_1.0.2 readr_2.1.5 tidyr_1.3.1 tibble_3.2.1 ggplot2_3.5.1 tidyverse_2.0.0 colorBlindness_0.1.9 BiocManager_1.30.25 knitr_1.49
loaded via a namespace (and not attached):
[1] RcppAnnoy_0.0.22 splines_4.3.1 later_1.4.1 bitops_1.0-9 polyclip_1.10-7 fastDummies_1.7.5 lifecycle_1.0.4 doParallel_1.0.17 processx_3.8.5 globals_0.16.3 lattice_0.22-6 MASS_7.3-60 crosstalk_1.2.1 backports_1.5.0 magrittr_2.0.3 sass_0.4.9 plotly_4.10.4 rmarkdown_2.29 jquerylib_0.1.4 yaml_2.3.10 httpuv_1.6.15 sctransform_0.4.1 spam_2.11-0 spatstat.sparse_3.1-0 reticulate_1.40.0 cowplot_1.1.3 pbapply_1.7-2 bayesm_3.1-6 RColorBrewer_1.1-3 abind_1.4-8 zlibbioc_1.48.2 Rtsne_0.17 GenomicRanges_1.54.1 BiocGenerics_0.48.1 RCurl_1.98-1.16 tensorA_0.36.2.1 circlize_0.4.16 GenomeInfoDbData_1.2.11 IRanges_2.36.0 S4Vectors_0.40.2 irlba_2.3.5.1 listenv_0.9.1
[43] spatstat.utils_3.1-2 goftest_1.2-3 RSpectra_0.16-2 spatstat.random_3.3-2 fitdistrplus_1.2-2 parallelly_1.41.0 codetools_0.2-20 DelayedArray_0.28.0 tidyselect_1.2.1 shape_1.4.6.1 farver_2.1.2 matrixStats_1.5.0 stats4_4.3.1 spatstat.explore_3.3-4 jsonlite_1.8.9 GetoptLong_1.0.5 progressr_0.15.1 ggridges_0.5.6 survival_3.8-3 iterators_1.0.14 foreach_1.5.2 tools_4.3.1 ica_1.0-3 Rcpp_1.0.14 glue_1.8.0 gridExtra_2.3 SparseArray_1.2.4 xfun_0.50 distributional_0.5.0 cmdstanr_0.8.1 MatrixGenerics_1.14.0 GenomeInfoDb_1.38.8 withr_3.0.2 instantiate_0.2.3 fastmap_1.2.0 callr_3.7.6 digest_0.6.37 timechange_0.3.0 R6_2.5.1 mime_0.12 gridGraphics_0.5-1 colorspace_2.1-1
[85] Cairo_1.6-2 scattermore_1.2 tensor_1.5 spatstat.data_3.1-4 generics_0.1.3 data.table_1.16.4 robustbase_0.99-4-1 httr_1.4.7 htmlwidgets_1.6.4 S4Arrays_1.2.1 uwot_0.1.16 pkgconfig_2.0.3 gtable_0.3.6 lmtest_0.9-40 SingleCellExperiment_1.24.0 XVector_0.42.0 htmltools_0.5.8.1 dotCall64_1.2 clue_0.3-66 Biobase_2.62.0 posterior_1.6.0 png_0.1-8 spatstat.univar_3.1-1 rstudioapi_0.17.1 tzdb_0.4.0 rjson_0.2.23 checkmate_2.3.2 nlme_3.1-166 cachem_1.1.0 zoo_1.8-12 GlobalOptions_0.1.2 KernSmooth_2.23-26 parallel_4.3.1 miniUI_0.1.1.1 pillar_1.10.1 vctrs_0.6.5 RANN_2.6.2 promises_1.3.2 xtable_1.8-4 cluster_2.1.8 evaluate_1.0.3 magick_2.8.5
[127] cli_3.6.3 compiler_4.3.1 rlang_1.1.4 crayon_1.5.3 future.apply_1.11.3 labeling_0.4.3 ps_1.8.1 fs_1.6.5 plyr_1.8.9 stringi_1.8.4 deldir_2.0-4 munsell_0.5.1 lazyeval_0.2.2 spatstat.geom_3.3-4 Matrix_1.6-5 RcppHNSW_0.6.0 hms_1.1.3 patchwork_1.3.0 future_1.34.0 shiny_1.10.0 SummarizedExperiment_1.32.0 ROCR_1.0-11 igraph_2.1.2 bslib_0.8.0 DEoptimR_1.1-3-1